﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using KylinORM.Utils;

namespace KylinORM.Aspect.Definition
{
    /// <summary>
    /// 定义实体的映射规则
    /// </summary>
    public interface IEntityDefinitionRule
    {
        /// <summary>
        /// 得到实体的默认设置
        /// </summary>
        /// <param name="entityType"></param>
        /// <returns></returns>
        EntityInfo GetEntityDefinition(Type entityType);
        /// <summary>
        /// 得到实体字段的默认设置
        /// </summary>
        /// <param name="propType"></param>
        /// <returns></returns>
        EntityFieldInfo GetEntityFieldDefinition(PropertyInfo propType);

        #region 可选参数
        /// <summary>
        /// 可选参数，设置实体的数据库表名
        /// </summary>
        string TableName { get; set; }
        /// <summary>
        /// 可选参数，设置实体的忽略字段
        /// </summary>
        string[] IgnoredFields { get; set; }
        /// <summary>
        /// 可选参数，设置实体的主键字段
        /// </summary>
        string[] PrimaryFields { get; set; }
        /// <summary>
        /// 可选参数，设置实体的索引字段
        /// </summary>
        string[] IdentityFields { get; set; }
        #endregion
    }
}
